package com.anjubao.parking.municipal.user.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 车牌类型
 *
 * @author zhuchunfeng
 * @date 2019/7/3 11:12
 */
@Getter
@AllArgsConstructor
public enum VehicleTypeEnum {

    BLUE(1, "汽油车"),
    GREEN(2, "新能源");

    private Integer code;

    private String desc;

    public static VehicleTypeEnum getByCode(Integer code) {
        for (VehicleTypeEnum e : VehicleTypeEnum.values()) {
            if (e.getCode().equals(code)) {
                return e;
            }
        }
        return null;
    }

    public static Boolean exist(Integer code) {
        for (VehicleTypeEnum e : VehicleTypeEnum.values()) {
            if (e.getCode().equals(code)) {
                return true;
            }
        }
        return false;
    }
}
